<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>享送小哥</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>

<body>
    <div id="header">
        <header class="aui-bar aui-bar-nav aui-bar-light u-aui-bar">
            <a href="javascript:api.closeWin();" class="aui-pull-left aui-btn"> <span class="aui-iconfont aui-icon-left"></span> </a>
            <div class="aui-title u-aui-title">优惠券</div>
        </header>
        <div class="aui-content">
            <div class="aui-tab deliv-tab order-tab" id="deliv-tab">
                <div class="aui-tab-item aui-active">未使用</div>
                <div class="aui-tab-item">已使用</div>
                <div class="aui-tab-item">已过期</div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/vue.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <script type="text/javascript" src="../script/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="../script/aui-tab.js"></script>
    <script type="text/javascript">
        apiready = function() {
            var statusBarPos = app.statusBar.pos();
            var headerPos = app.pos("header");

            api.openFrameGroup({
                name: 'my_cpupon_frame',
                rect: {
                    x: 0,
                    y: statusBarPos.h + headerPos.h,
                    w: 'auto',
                    h: 'auto'
                },
                scrollEnabled: true,
                frames: [{
                    name: 'my_coupon_content1',
                    url: 'my_coupon_content.html',
                    bounces: true,
                    pageParam: {
                        status: 1
                    }
                }, {
                    name: 'my_coupon_content2',
                    url: 'my_coupon_content.html',
                    bounces: true,
                    pageParam: {
                        status: 2
                    }
                }, {
                    name: 'my_coupon_content3',
                    url: 'my_coupon_content.html',
                    bounces: true,
                    pageParam: {
                        status: 3
                    }
                }]
            }, function(ret, err) {
                if (ret) {
                    $("#deliv-tab div:eq(" + ret.index + ")").addClass("aui-active").siblings().removeClass("aui-active");
                }
            });

        }
        var tab = new auiTab({
            element: document.getElementById("deliv-tab"),
        }, function(ret) {
            api.setFrameGroupIndex({
                name: 'my_cpupon_frame',
                index: ret.index - 1
            });
        });
    </script>
</body>

</html>
